<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>小飞象-计划管理-新建计划</title>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_810097_s50gcn082go.css">
    <link rel="stylesheet" href="../css/common/reset.css">
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../css/reset-layui.css">
    <link rel="stylesheet" href="../css/header.css">
    <link rel="stylesheet" href="../css/common/nav.css">
    <link rel="stylesheet" href="../css/common/aside.css">
    <link rel="stylesheet" href="../css/common/content.css">
    <link rel="stylesheet" href="../css/new.min.css">
    <script src="../js/jquery.min.js"></script>
</head>

<body>
    <header>
        <div class="wrapper">
            <div class="clearfix headerBox">
                <h1 class="fl logo">
                    <a href="">小飞象</a>
                </h1>
                <!-- <div class="fl alipayName">支付宝充值账号: <b class="redColor">156****8656</b>开户人: <b class="redColor">陈小窝</b></div> -->
                <div class="fr logOut">退出</div>
                <div class="fr userName"></div>
            </div>
        </div>
    </header>
    <div class="mhNav">
        <ul class="navMenuBox">
            <li>
                <a href="../index.html">
                    飞象首页
                </a>
            </li>
            <li>
                <a href="javascript:;">
                    会员中心
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../member/basicInfo.html">基本资料</a>
                    </li>
                    <li>
                        <a href="../member/storeMage.html">店铺管理</a>
                    </li>
                    <li>
                        <a href="../member/readjustNum.html">调整单量</a>
                    </li>
                    <li>
                        <a href="/goodsMage.html">商品管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;" class="active">
                    计划管理
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="newPlan.html">新建计划</a>
                    </li>
                    <li>
                        <a href="planMage.html">计划管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    订单管理
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../order/orderMage.html">订单管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    资金管理
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../capital/inAccout.html">账号充值</a>
                    </li>
                    <li>
                        <a href="../capital/transferMage.html">转账管理</a>
                    </li>
                    <li>
                        <a href="../capital/orderMage/dailyTaskDes.html">订单信息</a>
                    </li>
                    <li>
                        <a href="../capital/expressForm.html">获取快递底单</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="">在线客服</a>
            </li>
        </ul>
    </div>
    <div class="clearfix wrapper mainBomContent">
        <div class="asideMenu">
            <h2 class="title">
                <i class="iconfont icon--"></i> 计划管理
            </h2>
            <ul>
                <li class="active">
                    <a href="newPlan.html">新建计划</a>
                </li>
                <li>
                    <a href="planMage.html">计划管理</a>
                </li>
            </ul>
        </div>
        <div class="rightContent">
            <div class="newPlanView">
                <form class="layui-form-pane" layui-filter="newPlanFilter">
                    <div class="clearfix taskCheck">
                        <h2>任务类型选择</h2>
                        <ul>
                            <li class="selected">
                                <input type="radio" hidden>
                                <h3>日产销售任务</h3>
                                <dl>
                                    <dt>安全</dt>
                                    <dd>
                                        兼职真实买家 ,一人一号永不复购</dd>
                                    <dt>高权重</dt>
                                    <dd>
                                        实名主号，三心以上。可对目标客户进行定位</dd>
                                    <dt>智能化</dt>
                                    <dd>
                                        自动标记、发货、对账<b style="color: Red">（必须开通智能助手）</b></dd>
                                </dl>
                                <div class="checkRightBox">
                                    <i class="iconfont icon-gou"></i>
                                </div>
                            </li>
                            <!-- <li style="background:#f5f5f5;cursor: not-allowed;">
                                <input type="radio" hidden>
                                <h3>指定推送任务</h3>
                                <dl>
                                    <dt class="fl yBgKuoHao">预约任务
                                        <br>
                                        <b class="psColor font12">(次日下单)</b></dt>
                                    <dd class="mt10">
                                        指定用户当日收藏<br> 指定用户当日加购
                                        <br> 指定用户当日浏览
                                    </dd>
                                    <div style="clear:both;"></div>
                                    <dt>全面性</dt>
                                    <dd>
                                        包含销量任务的所有特点</dd>
                                    <dt>智能化</dt>
                                    <dd>
                                        自动标记、发货、对账<b style="color: Red">（必须开通智能助手）</b></dd>
                                </dl>
                                <div class="checkRightBox">
                                    <i class="iconfont icon-gou"></i>
                                </div>
                            </li> -->
                            <!-- style="background:#f5f5f5;cursor: not-allowed;" -->
                            <li>
                                <input type="radio" hidden>
                                <h3>复购任务</h3>
                                <dl>
                                    <dt>个性化下单路径</dt>
                                    <dd>
                                        指定用户复购</dd>
                                    <dt>全面性</dt>
                                    <dd>
                                        包含销量任务的所有特点</dd>
                                    <dt>智能化</dt>
                                    <dd>
                                        自动标记、发货、对账<b style="color: Red">（必须开通智能助手）</b></dd>
                                </dl>
                                <div class="checkRightBox">
                                    <i class="iconfont icon-gou"></i>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <h2>新建计划</h2>
                    <div class="layui-form-item newTitle">
                        <div class="text">选定商品</div>
                        <div class="right">
                            <span class="checkGoods">选择商品</span>
                        </div>
                    </div>
                    <table class="getGoodsInfoTable">
                        <input type="hidden" id="shopId">
                        <input type="hidden" id="goodsPhoto">
                        <input type="hidden" id="goodsid">
                        <tbody>
                            <tr>
                                <th width="182">
                                    商品简称
                                </th>
                                <td width="700" id="goodsInfo"></td>
                                <td width="208" rowspan="7" class="imgParent">
                                    <img src="" width=" 200" height="200" id="goodsImg" />
                                </td>
                            </tr>
                            <!-- <tr>
                                <th width="182">
                                    商品ID&nbsp;&nbsp;&nbsp;
                                </th>
                                <td width="700" id="goodsid">
                                </td>
                            </tr> -->
                            <!-- <tr>
                                <th width="182">
                                    店铺名&nbsp;&nbsp;&nbsp;
                                </th>
                                <td width="700" id="tdShopName">
                                    阿瓦印象瓷砖店 </td>
                            </tr> -->
                            <tr>
                                <th width="182">
                                    商品标题
                                </th>
                                <td width="700" id="goodsName"></td>
                            </tr>
                            <tr>
                                <th width="182">
                                    商品重量
                                </th>
                                <td width="700" id="weight">

                                </td>
                            </tr>
                            <tr>
                                <th width="182">
                                    搜索显示价格
                                </th>
                                <td width="700" style="word-wrap: break-word" id="price">
                                </td>
                            </tr>
                            <tr>
                                <th width="182">
                                    付款人数
                                </th>
                                <td width="700" style="word-wrap: break-word" id="priceNum">
                                </td>
                            </tr>
                            <tr>
                                <th width="182">
                                    商品所在地
                                </th>
                                <td width="700" style="word-wrap: break-word" id="address">
                                </td>
                            </tr>
                            <tr>
                                <th width="182">
                                    商品链接
                                </th>
                                <td width="700" style="word-wrap: break-word" id="goodsLink">
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <!-- <div class="layui-form-item">
                        <label class="layui-form-label">指定掌柜</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" autocomplete="off" placeholder="请输入绑定店铺的旺旺号" class="layui-input"
                                id="shopkeeper" lay-verify="shopkeeper">
                        </div>
                    </div> -->
                    <!-- <div class="layui-form-item">
                        <label class="layui-form-label">掌柜昵称</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" autocomplete="off" placeholder="请输入绑定店铺的旺旺号" class="layui-input"
                                id="shopkeeperName">
                        </div>
                    </div> -->
                    <!-- <div class="layui-form-item">
                        <label class="layui-form-label">掌柜昵称</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" autocomplete="off" placeholder="请输入主号掌柜昵称" class="layui-input">
                        </div>
                    </div> -->
                    <!-- <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">搜索显示价格￥</label>
                            <div class="layui-input-inline" style="width: 120px;">
                                <input type="text" name="price_min" placeholder="请输入搜索价格" autocomplete="off" class="layui-input"
                                    id="goodsPrice">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">付款人数约</label>
                            <div class="layui-input-inline" style="width: 120px;">
                                <input type="text" name="price_min" placeholder="请输入付款人数" autocomplete="off" class="layui-input"
                                    id="goodsBuyNum">
                            </div>
                        </div>
                        <div class="layui-inline" style="margin-right: 0;">
                            <label class="layui-form-label">商品所在地</label>
                            <div class="layui-input-inline" style="width: 241px;margin-right: 0;">
                                <input type="text" name="price_min" placeholder="请输入商品所在地" autocomplete="off" class="layui-input"
                                    id="goodsAddress">
                            </div>
                        </div>
                    </div> -->
                    <div class="layui-form-item" pane="">
                        <label class="layui-form-label">搜索方式选择</label>
                        <div class="layui-input-block">
                            <select id="goodsSearch">
                                <option value="1">淘宝APP自然搜索（手机端）</option>
                                <option value="2">淘宝PC端自然搜索</option>
                                <option value="3">淘宝APP淘口令</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item" pane="">
                        <label class="layui-form-label">自动发货</label>
                        <div class="layui-input-block">
                            <input type="checkbox" id="autoDelivery" value="0">
                        </div>
                    </div>
                    <div class="layui-form-item" pane="">
                        <label class="layui-form-label">关键词设置</label>
                        <div class="layui-input-block">
                            <div class="addKeyWord fAddKeyWord">
                                +新增关键词
                            </div>
                        </div>
                    </div>
                    <table class="layui-table" id="optionContainer">
                        <colgroup>
                            <col width="400">
                            <col width="90">
                            <col width="110">
                            <col width="90">
                            <col width="140">
                            <col width="200">
                            <col width="120">
                        </colgroup>
                        <thead>
                            <tr>
                                <th>关键词</th>
                                <th>单量(单)</th>
                                <th>每单拍(件)</th>
                                <th>单价(元)</th>
                                <th>每单总价(元)</th>
                                <th>总价格(元)</th>
                                <th>操作按钮</th>
                            </tr>
                        </thead>
                        <tbody id="keyWordList">
                            <tr id="trHideSearch">
                                <td>
                                    <input type="text" name="word[]" maxlength="500" value="" placeholder="请设置关键字"
                                        class="word">
                                </td>
                                <td>
                                    <input type="text" value="" class="changes changes1" name="orderNum[]" onkeyup="this.value=this.value.replace(/\D/g,'')"
                                        onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                </td>
                                <td>
                                    <input type="text" value="" class="changes changes2" name="orderSize[]" onkeyup="this.value=this.value.replace(/\D/g,'')"
                                        onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                </td>
                                <td>
                                    <input type="text" value="" class="changes changes3" name="price[]" onkeyup="if(isNaN(value))execCommand('undo')"
                                        onafterpaste="if(isNaN(value))execCommand('undo')">
                                </td>
                                <td>
                                    <input type="text" placeholder="单价X每单件数" name="countPrice[]" class="countPrice"
                                        disabled>
                                </td>
                                <td>
                                    <input type="text" placeholder="单价X每单件数X单量" class="totalPrice" disabled>
                                </td>
                                <td>
                                    <input type="button" value="删除" onclick="delRow()" />
                                </td>
                            </tr>
                            <!-- <tr>
                                <td>
                                    <input type="text" name="word[]" maxlength="500" value="" placeholder="请设置关键字"
                                        class="word">
                                </td>
                                <td>
                                    <input type="text" value="0" class="changes changes1" name="orderNum[]" onkeyup="this.value=this.value.replace(/\D/g,'')"
                                        onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                </td>
                                <td>
                                    <input type="text" value="0" class="changes changes2" name="orderSize[]" onkeyup="this.value=this.value.replace(/\D/g,'')"
                                        onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                </td>
                                <td>
                                    <input type="text" value="0" class="changes changes3" name="price[]" onkeyup="if(isNaN(value))execCommand('undo')"
                                        onafterpaste="if(isNaN(value))execCommand('undo')">
                                </td>
                                <td>
                                    <input type="text" placeholder="单价X每单件数" name="countPrice[]" class="countPrice">
                                </td>
                                <td>
                                    <input type="text" placeholder="单价X每单件数X单量" class="totalPrice">
                                </td>
                                <td>
                                    <input type="button" value="删除" onclick="delRow()" />
                                </td>
                            </tr> -->
                        </tbody>
                    </table>
                    <!-- <div class="layui-form-item" pane="">
                        <label class="layui-form-label">设置类型</label>
                        <div class="layui-input-block" id="allocationRules" style="line-height:38px;margin-left: 161px;">
                            <label>
                                <input type="radio" name="sex" value="0" title="平均分配" checked="">平均分配
                            </label>
                            <label>
                                <input type="radio" name="sex" value="1" title="定时无限制30单/天">定时无限制30单/天
                            </label>
                        </div>
                    </div> -->
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">时间选择</label>
                            <input type="hidden" id="planBeginDate">
                            <input type="hidden" id="planEndDate">
                            <div class="layui-input-inline" style="width: 160px;">
                                <input class="laydate-icon layui-input" id="BeginDate" maxlength="16" name="BeginDate"
                                    type="text" value="" placeholder="开始时间" autocomplete="off" readonly="" />
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 160px;">
                                <input class="laydate-icon layui-input" id="EndDate" maxlength="16" name="EndDate" type="text"
                                    value="" placeholder="结束时间" autocomplete="off" readonly="" />
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">备注说明</label>
                        <div class="layui-input-block">
                            <textarea placeholder="请输入内容，最多30个汉字" class="layui-textarea" id="bak"></textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn" type="button" lay-submit lay-filter="Splan">确认提交</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="../js/jquery.cookie.js"></script>
    <script src="../js/timechange.js"></script>
    <script src="../layui/layui.js"></script>
    <script src="../js/dataRequest.js"></script>
    <script>
        $(".changes").live("input", function () {
            var id = $(this).parent("td").parent("tr").attr("id");
            console.log(id)
            changes(id, $("#" + id).find(".changes1").val(), $("#" + id).find(".changes2").val(), $("#" + id).find(".changes3").val());
            console.log($("#" + id).find(".changes2").val())
        })

        var taskCheck = $(".taskCheck");
        taskCheck.find("li").click(function () {
            $(this).addClass("selected").siblings().removeClass("selected");
        });
        function changes(id, num, totalNum, price) {
            //console.log(id.parent("td").parent("tr").find(".countPrice"))
            $("#" + id).find(".countPrice").val(totalNum * price)
            $("#" + id).find(".totalPrice").val((num * totalNum * (price * 100)) / 100)
        }
        var mid = $.cookie('id');
        if (!mid) {
            window.location.href = "/login.html";
        }
        $(".mhNav .navMenuBox > li > a").click(function (event) {
            if ($(this).siblings('ul').is(':visible')) {
                $(this).siblings('ul').stop(true, true).slideUp();
                $(this).removeClass('active')
            } else {
                $(this).siblings('ul').stop(true, true).slideDown().parents('li').siblings().find('ul').stop(
                    true, true).slideUp();
                $(this).addClass('active').parents('li').siblings().find('a').removeClass('active');
            }
        });

        var rowCount = 20; //行数序列默认从20开始
        $(".fAddKeyWord").click(function () {
            addRow();
        });

        //添加行
        function addRow() {
            rowCount++;
            var seartypeNum = $("#optionContainer input[name='word[]']").length;
            if (seartypeNum > 20) {
                alert("最多只能添加关键词20行");
            } else {

                //添加行内容
                var aDlist = $("#trHideSearch").clone(true).html();
                var trID = 'option' + rowCount;
                aDlist = aDlist.replace('delRow()', "delRow(" + rowCount + ")");
                // aDlist = aDlist.replace('word()', "word(" + rowCount + ")");
                $('#optionContainer').find('tbody').append("<tr id=" + trID + ">" + aDlist + "</tr>");
            }
        }
        //删除行
        function delRow(rowIndex) {
            $("#option" + rowIndex).remove();
        }
        layui.use(['layer', 'laydate', 'form'], function () {
            var form = layui.form,
                layer = layui.layer,
                laydate = layui.laydate,
                pageNum = 1;

            // 获取商品信息
            $(".checkGoods").on("click", function () {
                layer.open({
                    type: 2 //此处以iframe举例
                    ,
                    title: '商品列表',
                    area: ['700px', '400px'],
                    shadeClose: true //开启遮罩关闭
                    ,
                    offset: 'auto',
                    scrollbar: true,
                    content: ['/getGoodsLists.html'],
                    zIndex: layer.zIndex //重点1
                });
            });
            form.on('submit(Splan)', function () {
                // var shopkeeper = $("#shopkeeper").val();
                var goodsLink = $("#goodsLink").text();
                console.log("goodLink", goodsLink);
                var goodsTitle = $("#goodsName").text();
                var goodsId = $("#goodsid").val();
                var goodsPhoto = $("#goodsPhoto").val();
                console.log("goodsId", goodsId);
                console.log(typeof (goodsId));
                var shopId = $("#shopId").val();
                // var shopkeeperName = $("#shopkeeperName").val();
                var goodsWeight = $("#weight").text();
                var price = $("#price").text();
                var priceNum = $("#priceNum").text();
                var address = $("#address").text();
                var goodsBuyPrice = $("#goodsBuyPrice").val();
                var goodsSearch = $("#goodsSearch option:selected").val();
                var autoDelivery = $("#autoDelivery").attr("checked") ? value = 1 : value = 0;

                // var allocationRules = $("#allocationRules input[type='radio']:checked").val();
                // console.log("allocationRules", allocationRules);
                var bak = $("#bak").val();
                var planStartTime = $("#planBeginDate").val();
                var planEndTime = $("#planEndDate").val();
                if (!shopId) {
                    console.log("你来了么");
                    layer.open({
                        title: "提示",
                        content: "您还未选择商品"
                    });
                    return;
                }
                // if (!shopkeeper) {
                //     layer.open({
                //         title: "提示",
                //         content: "您未填写指定掌柜"
                //     });
                //     return;
                // }
                // if (!shopkeeperName) {
                //     layer.open({
                //         title: "提示",
                //         content: "您未填写掌柜昵称"
                //     });
                //     return;
                // }
                // if (!goodsPrice) {
                //     layer.open({
                //         title: "提示",
                //         content: "您未填写搜索显示价格"
                //     });
                //     return;
                // }
                // if (isNaN(goodsPrice)) {
                //     layer.open({
                //         title: "提示",
                //         content: "搜索显示价格请输入有效金额"
                //     });
                //     return;
                // }
                // if (!goodsBuyNum) {
                //     layer.open({
                //         title: "提示",
                //         content: "您未填写付款人数"
                //     });
                //     return;
                // }
                // else if (isNaN(goodsBuyNum)) {
                //     layer.open({
                //         title: "提示",
                //         content: "付款人数请输入数字"
                //     });
                //     return;
                // }
                // if (!goodsAddress) {
                //     layer.open({
                //         title: "提示",
                //         content: "您未填写商品所在地"
                //     });
                //     return;
                // }
                if (!planStartTime) {
                    layer.open({
                        title: "提示",
                        content: "您未选择开始时间"
                    });
                    return;
                }
                if (!planEndTime) {
                    layer.open({
                        title: "提示",
                        content: "您未选择结束时间"
                    });
                    return;
                }
                if (!bak) {
                    layer.open({
                        title: "提示",
                        content: "您未填写备注"
                    });
                    return;
                }
                var keyWordsArr = $("#keyWordList input[type='text']").not(
                    "#keyWordList tr:first-child input[type='text']");
                for (var i = 0; i < keyWordsArr.length; i++) {
                    if (keyWordsArr.eq(i).val() == "") {
                        layer.open({
                            title: "提示",
                            content: "关键词未填写完整"
                        });
                        return false;
                    }
                }
                var data = [];
                $("#keyWordList input[name='word[]']").each(function (index, item) {
                    data[index] = {};
                    data[index].word = $(this).val();
                });
                $("#keyWordList input[name='orderNum[]']").each(function (index, item) {
                    data[index].orderNum = $(this).val();
                });
                $("#keyWordList input[name='orderSize[]']").each(function (index, item) {
                    data[index].orderSize = $(this).val();
                });
                $("#keyWordList input[name='price[]']").each(function (index, item) {
                    data[index].price = $(this).val();
                });
                $("#keyWordList input[name='countPrice[]']").each(function (index, item) {
                    data[index].countPrice = $(this).val();
                });
                console.log("data", data);
                var JdateJson = {
                    "merchantsId": mid,
                    "goodsLink": goodsLink,
                    "goodsTitle": goodsTitle,
                    "goodsId": goodsId,
                    "shopId": shopId,
                    "goodsPhoto": goodsPhoto,
                    "goodsWeight": goodsWeight,
                    "goodsPrice": price,
                    "goodsBuyNum": priceNum,
                    "goodsAddress": address,
                    "goodsSearch": goodsSearch,
                    "planType": 1,
                    "dumboPlanAllot": data,
                    "bak": bak,
                    "planStartTime": planStartTime,
                    "planEndTime": planEndTime,
                    "allocationRules": 1,
                    "autoDelivery": autoDelivery
                }
                $.ajax({
                    url: BASE_URL + MAP_URL + "/plan",
                    type: 'POST',
                    dataType: 'json',
                    contentType: "application/json;charset=utf-8",
                    data: JSON.stringify(JdateJson),
                    success: function (data) {
                        // return;
                        var _Success = data.code;
                        if (_Success == 200) {
                            layer.msg("提交成功");
                            window.location = "/plan/planMage.html";
                        } else {
                            layer.msg(data.data);
                        }
                    }
                })
                //防止页面跳转
                return false;
            });
            //日期范围
            var startDate = laydate.render({
                elem: '#BeginDate',
                type: 'datetime',
                format: 'yyyy-MM-dd HH:mm',
                min: minDate(),
                max: "2099-12-31", //设置一个默认最大值
                done: function (value, date) {
                    endDate.config.min = {
                        year: date.year,
                        month: date.month - 1, //关键
                        date: date.date,
                        hours: 0,
                        minutes: 0,
                        seconds: 0
                    };
                    console.log("你是我选择的日期", value);
                    var BeginDateT = $.time.dataCommon(value);
                    $("#planBeginDate").val(BeginDateT);
                    // console.log("选择的日期", BeginDateT);
                    // $.cookie("beginT", BeginDateT);
                }
            });
            var endDate = laydate.render({
                elem: '#EndDate', //选择器结束时间
                type: 'datetime',
                format: 'yyyy-MM-dd HH:mm',
                min: minDate(), //设置min默认最小值
                done: function (value, date) {
                    startDate.config.max = {
                        year: date.year,
                        month: date.month - 1, //关键
                        date: date.date,
                        hours: 0,
                        minutes: 0,
                        seconds: 0
                    }
                    console.log("你是我选择的日期", value);
                    var endDateT = $.time.dataCommon(value);
                    $("#planEndDate").val(endDateT);
                }
            });
            form.render();
        });
        //获取子界面传值
        function GetValue(obj) {
            console.log(obj);
            $.ajax({
                type: "GET",
                url: BASE_URL + MAP_URL + 'goods/' + obj,
                dataType: "json",
                global: false,
                success: function (data) {
                    console.log("data", data);
                    $("#goodsInfo").text(data.data.goodsInfo);
                    $("#goodsLink").text(data.data.goodsLink);
                    $("#goodsName").text(data.data.goodsName);
                    $("#goodsid").val(data.data.id);
                    $("#weight").text(data.data.weight + "KG");
                    $("#goodsImg").attr("src", data.data.goodsImg);
                    $("#shopId").val(data.data.shopId);
                    $("#goodsPhoto").val(data.data.goodsImg);
                    $("#price").text(data.data.price);
                    $("#address").text(data.data.address);
                    $("#priceNum").text(data.data.priceNum);
                }
            });
        }
        // 设置最小可选的日期
        function minDate() {
            var now = new Date();
            return now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();
        }
        $.ajax({
            type: "get",
            url: "http://47.92.174.143:8888/v1/client/merchants/" + mid,
            dataType: 'json',
            success: function (data) {
                // console.log("请求数据为", data.data)
                // 存储总额
                if (data.data == null || !data.data) {
                    layer.msg('数据出错,请重新登录', {
                        icon: 5,
                        time: 6000,
                        end: function () {
                            location.href = '/login.html';
                        }
                    });
                } else {
                    $(".userName").html(data.data.loginId);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) { }
        });
    </script>
</body>

</html>